-
Notifications
You must be signed in to change notification settings - Fork 342
Adds a system which enables exporting occupancy grids. #2958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR adds a system which exports occupancy grids. Currently its a work in progress. The BFS algorithm seems to not identify when there cannot be any progress made. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
This commit pushes an initial version of the code. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Here's a patch to add the bazel.patchdiff --git a/BUILD.bazel b/BUILD.bazel
index 9d6d2d9bb..01bc304ad 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -801,6 +801,26 @@ gz_sim_system_libraries(
],
)
+gz_sim_system_libraries(
+ srcs = glob(
+ [
+ "src/systems/free_space_explorer/**/*.cc",
+ "src/systems/free_space_explorer/**/*.hh",
+ ],
+ ),
+ so_lib_name = "gz-sim-free-space_explorer--system.so",
+ static_lib_name = "gz-sim-free-space-explorer-system-static",
+ visibility = ["//visibility:public"],
+ deps = [
+ ":gz-sim",
+ "@gz-common//graphics",
+ "@gz-math",
+ "@gz-msgs//:gzmsgs_cc_proto",
+ "@gz-plugin//:register",
+ "@gz-transport",
+ ],
+)
+
gz_sim_system_libraries(
srcs = glob(
[ After removing |
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
…m/gz-sim into arjo/feat/export_occupancy_grid
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall feature looks great! I have some concerns about where the computation is being done. In most of our plugins, we have the pattern where we only do trivail things in message callbacks and defer expensive computation to Pre/PostUpdate
calls. There also a number of style issues.
AI was used to migrate the logic in OnLaserScanCallback. Generated-by: Gemini-2.5-Pro Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
…m/gz-sim into arjo/feat/export_occupancy_grid
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Since we are accessing the occupancy grid on the main simulation loop only now, we dont need a mutex to protect it. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for making all those changes.
Let's merge as is, but I'd ask if you can follow this up with an integration test.
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
🎉 New feature
Closes #
Summary
Depends on: gazebosim/gz-math#685
This PR adds a system which exports occupancy grids. Currently its a work in progress. The BFS algorithm takes a fair deal of time to converge, hence writing a unit test may not make sense. We should also make a nice UI for it.
Test it
Follow the instructions in the example sdf.
The occupancy grid will be published as an image on the /scan_image topic.
To start the exploration, run the following command in a new terminal:
reduced_Screencast.From.2025-08-22.13-24-20.mp4
Checklist
codecheck
passed (See contributing)Generated-by: Gemini-2.5-Pro
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
andGenerated-by
messages.